<?php
require_once('classes/Databases.class.php');

class Pesan extends Databases{
  protected $sqlFile='com/pesan/bussines/pesan.sql.php';
  public function __construct(){
    parent::__construct();
  }
  function getPesanByPenerima($penerima){
    $result=$this->open($this->sqlQueries['get_pesan_by_penerima'],array($penerima));
    return $result;
  }
  function getPesanByPengirim($pengirim){
    $result=$this->open($this->sqlQueries['get_pesan_by_pengirim'],array($pengirim));
    return $result;
  }
  function getPesanById($psnId){
    $result=$this->open($this->sqlQueries['get_pesan_by_id'],array($psnId));
    return $result;
  }
  function doAddPesan($pesanSubjek,$pesanPenerima,$pesanPengirim,$pesanIsi,$pesanIsBaca){
    $result=$this->execute($this->sqlQueries['do_add_pesan'],array($pesanSubjek,$pesanPenerima,$pesanPengirim,$pesanIsi,$pesanIsBaca));
    return $result;
  }
}
?>
